import { axios } from '@/utils/request'

/**
 * api接口列表
 */
const api = {
  list: '/suppdata.datalist/list',
  importData: '/suppdata.datalist/importData',
  getsaleslist: '/suppdata.datalist/getsaleslist',
  bindsales: '/suppdata.datalist/bindsales',
  delete: '/suppdata.datalist/delete'
}

/**
 * 列表记录
 */
export function list (params) {
  return axios({
    url: api.list,
    method: 'get',
    params
  })
}

/**
 * 获取销售列表
 */
export function getsaleslist (params) {
  return axios({
    url: api.getsaleslist,
    method: 'post',
    params
  })
}

/**
 * 绑定销售
 * @param {*} data
 */
export function bindsales (data) {
  return axios({
    url: api.bindsales,
    method: 'post',
    data
  })
}

/**
 * 导入excel方法
 */
export function importData (data) {
  return axios({
    url: api.importData,
    method: 'post',
    data
  })
}
/**
 * 删除记录
 * @param {*} data
 */
export function deleted (data) {
  return axios({
    url: api.delete,
    method: 'post',
    data: data
  })
}
